package com.xinnet.mms.emp.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.xinnet.mms.allot.dao.impl.BaseDaoImpl;
import com.xinnet.mms.emp.dao.PartyDao;
import com.xinnet.mms.entity.Emp;
import com.xinnet.mms.entity.Party;

@Repository("partyDao")
public class PartyDaoImpl extends BaseDaoImpl<Object, Object> implements PartyDao {

	/**从db.hymanager.Party表获取所有员工信息*/
	@Override
	public List<Emp> getAllEmp() throws SQLException {
		return this.getSqlSession().selectList("party.getAllEmp");
	}

	/**匹配db.xinnet091020.party/emp表 员工是否离职*/
	@Override
	public Integer getEmpStatuByEmpno(String empno) throws SQLException {
		return this.getSqlSession().selectOne("party.getEmpStatuByEmpno",empno);
	}

	@Override
	public List<Party> getAllPartyByptId(String ptId) {
		return this.getSqlSession().selectList("party.getNameByPratyTypeId",ptId);
	}
	
	
}
